package com.zhang.teachingcommunity_spring.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhang.teachingcommunity_spring.mapper.SchoolMapper;
import com.zhang.teachingcommunity_spring.mapper.entity.School;
import com.zhang.teachingcommunity_spring.mapper.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SchoolService {
    @Autowired
    private SchoolMapper schoolMapper;
    public List<School> getSchools() {
        QueryWrapper<School> schoolQueryWrapper = new QueryWrapper<>();
        List<School> schools = schoolMapper.selectList(schoolQueryWrapper);
        return schools;
    }
    public School getSchoolById(Integer id) {
        School school = schoolMapper.selectById(id);
        return school;
    }
}
